package edu.whu.xterm;

import android.os.Parcel;
import android.os.Parcelable;

public class Article implements Parcelable {
	public int id;
	public String title;
	public String author;
	public String board;
	public String time;
	public CharSequence content;
	public String signature;
	public String from;
	public String ip;

	public Article() {

	}

	public Article(Parcel in) {
		this.id = in.readInt();
		this.title = in.readString();
		this.author = in.readString();
		this.board = in.readString();
		this.time = in.readString();
		this.content = in.readString();
		this.signature = in.readString();
		this.from = in.readString();
		this.ip = in.readString();
	}

	Article(int id, String title, String author, String board, String time, CharSequence content,
			String signature, String from, String ip) {
		super();
		this.id = id;
		this.title = title;
		this.author = author;
		this.board = board;
		this.time = time;
		this.content = content;
		this.signature = signature;
		this.from = from;
		this.ip = ip;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeString(title);
		dest.writeString(author);
		dest.writeString(board);
		dest.writeString(time);
		dest.writeString(content.toString());
		dest.writeString(signature);
		dest.writeString(from);
		dest.writeString(ip);
	}

	public static final Creator<Article> CREATOR = new Creator<Article>() {

		@Override
		public Article createFromParcel(Parcel source) {
			return new Article(source);
		}

		@Override
		public Article[] newArray(int size) {
			return new Article[size];
		}

	};
}
